<template>
    <div>
        <template v-if="dataList.length > 0">
            <el-space wrap class="boxImg" :size="30">
                <img v-for="item, index in dataList" :src="baseUrl + item.certificateId" class="img" />
            </el-space>
        </template>
        <template v-else>
            <el-empty :image-size="200" description="暂无证书" />
        </template>
    </div>
</template>

<script setup name="myCertificate">
import { getUserCertificate } from '@/api/knowledgeLearn/online/practiceInClass.js';
const baseUrl = import.meta.env.VITE_APP_BASE_API + "/attachment/downLoadFile?attachId=";
const dataList = ref([])
function userCertificate() {
    getUserCertificate().then(res => {
        dataList.value = res.data;
        console.log(res.data, 'lalalla');
    })
}

onMounted(() => {
    userCertificate();
})
</script>

<style scoped lang="scss">
.boxImg{
    margin-top: 20px;
    .img {
    width: 350px;
    height: 495px;
}
}

</style>